#include "fxcc/yml/Serializer.h"
#include "fxcc/core/audio/common/AudioMetaCacheFile.h"

template<>
void fxcc::yml::Serializer::Encode<AudioMetaCache>(YAML::Node& node, const AudioMetaCache& inst)
{
	auto func = [=](const MetaMapIndex& index) {
		return fs::exists(index.m_NativeFile); };

	SetArrayVariable<MetaMapIndex>(node, "m_Audios", inst.m_Audios, func);

}


template<>
bool fxcc::yml::Serializer::Decode<AudioMetaCache>(const YAML::Node& node, AudioMetaCache& inst)
{
	GetArrayVariable<MetaMapIndex>(node, "m_Audios", inst.m_Audios);
	return true;
}